import {view, View, binder} from "adajs";
import BarService from "./state.js";

@view({
    className: "bar",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: BarService
    }
})
class Bar extends View {
    @binder("goBack")
    goBack() {
        window.history.back();
    }

    @binder("action")
    action({btn}) {
        this.dispatchEvent(`bar-${btn.action}`, btn);
    }
}

export default Bar;